﻿using System;

namespace enyo
{
    public class Pane : Control
    {
        public Transitions TransitionKind{get;set;}

        /// <summary>
        /// Event that fires whenever a view is selected. The event contains the current view and previous view.
        /// </summary>
        //TODO:inSender, inView, inPreviousView
        public EnyoEvent<Control, Control, Control> onSelectView;

        /// <summary>
        /// Event that fires when a view is selected by name but does not exist in either the view list or the set of lazy marked views. 
        /// Handle this event to dynamically create the view. The event contains the requested view name.
        /// </summary>
        //TODO:insender, name
        public EnyoEvent<Control, string> onCreateView;


        /// <summary>
        /// Returns the currently selected view.
        /// </summary>
        public Control GetView()
        {
            return null;
        }

        /// <summary>
        /// Returns the index of the currently selected view.
        /// </summary>
        /// <returns></returns>
        public int GetViewIndex()
        {
            return 0;
        }

        /// <summary>
        /// Returns the name of the currently selected view.
        /// </summary>
        /// <returns></returns>
        public string GetViewName()
        {
            return null;
        }

        /// <summary>
        /// Selects the view specified by the view reference.
        /// Fires the onSelectView event. 
        /// Set sync to true to ensure that the view is selected sychronously.
        /// </summary>
        /// <param name="view"></param>
        /// <param name="sync"></param>
        public void SelectView(Control view, bool sync)
        {
        }

        /// <summary>
        /// Selects the view with the index.
        /// Fires the onSelectView event.
        /// Set sync to true to ensure that the view is selected sychronously.
        /// </summary>
        /// <param name="index"></param>
        /// <param name="sync"></param>
        public void SelectViewByIndex(int index, bool sync)
        {
        }

        /// <summary>
        /// Selects the view with the name.
        /// Fires the onSelectView event.
        /// Set sync to true to ensure that the view is selected sychronously.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="sync"></param>
        public void SelectViewByName(string name, bool sync)
        {
        }

        /// <summary>
        /// Checks whether the view specified by inName exists. 
        /// If it does not exist, attempts to create the view by name from the list of lazy marked views.
        /// If the view is not found, fires the onCreateView event, which can be implemented to dynamically create a view by name.
        /// </summary>
        /// <param name="name"></param>
        public void ValidateView(string name)
        {
        }
    }
}
